package org.freeocs.entity;

import javax.servlet.http.HttpServletRequest;

import org.freeocs.Globals;

public class User extends Pojo {
	private static final long serialVersionUID = -7657282654910834071L;
	public final static transient byte ROLE_GENERAL = 0x00;
	public final static transient byte ROLE_NOTHING = 0x01;
	private String pwd;
	private String mail;
	private String name;
	private byte role;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public static User GetLoginUser(HttpServletRequest req) {
		return (User) req.getSession().getAttribute(Globals.RANDOM_LOGIN_KEY);
	}

	public byte getRole() {
		return role;
	}

	public void setRole(byte role) {
		this.role = role;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}
}
